﻿@model KPIS.GERP.Models.ICM.DeliveryNotePenalty
@{
    Layout = "~/Views/Shared/_EmptyLayout.cshtml";
    ViewBag.Title = "ตรวจรับพัสดุ";
    ViewBag.Descr = "บันทึกการปรับ";

    var modelDN = (DeliveryNote)ViewBag.ModelDn;
}
@*if (ViewContext.RouteData.Values["action"].ToString().ToLower() == "Create") { @Html.HiddenFor(model => model.DeliveryNote.PoId),@Html.HiddenFor(model => model.DnId) }*@
@using (Html.BeginForm("Create", "DeliveryNotePenalty", FormMethod.Post, new { id = "form", @class = "form-horizontal" }))
{
        @Html.AntiForgeryToken()

    <div class="span12 block-button-menu-above">
        <a class="btn button-standard-width btn-small btn-gray" data-rel="tooltip" role="button"
             href="@Url.Action("Index", new { DnId = (int)ViewBag.DnId, PoId = (int)ViewBag.PoId})">
            <i class="icon-reply bigger-120"></i>&nbsp;&nbsp;กลับไปหน้าแสดงข้อมูลการตรวจรับ
        </a>
        @Html.ButtonSubmit()
    </div>

  
    @Html.Partial("_EditorForm")
}
@section Scripts {
    

<script type="text/javascript" >

    //$('.date-picker').datepicker({ language: 'th-th', format: 'dd/mm/yyyy' });

    // ให้ใส่ได้เฉพาะตัวเลข
    $("#txtAmount").bind('keypress', function (e) {
        return (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) ? false : true;
    })

    $("form").submit(function (e) {
        e.preventDefault();
        var currentForm = this;
        bootbox.confirm("ต้องการบันทึก ใช่หรือไม่?", function (result) {
            if (result) {
                currentForm.submit();
            }
        });
    });  
      </script>
}